<template>
  <ContentWrap>
    <!-- 搜索工作栏 -->
    <el-form
      class="-mb-15px"
      :model="queryParams"
      ref="queryFormRef"
      :inline="true"
      label-width="68px"
    >
      <el-form-item :label="t('ustcStudentInfoUniversity.fields.accountId')" prop="accountId">
        <el-input
          v-model="queryParams.accountId"
          :placeholder="
            t('common.inputTextPlaceholder') + t('ustcStudentInfoUniversity.fields.accountId')
          "
          clearable
          @keyup.enter="handleQuery"
          class="!w-240px"
          :disabled="advancedSearching"
        />
      </el-form-item>
      <el-form-item :label="t('ustcStudentInfoUniversity.fields.inschoolFlag')" prop="inschoolFlag">
        <el-input
          v-model="queryParams.inschoolFlag"
          :placeholder="
            t('common.inputTextPlaceholder') + t('ustcStudentInfoUniversity.fields.inschoolFlag')
          "
          clearable
          @keyup.enter="handleQuery"
          class="!w-240px"
          :disabled="advancedSearching"
        />
      </el-form-item>
      <el-form-item
        :label="t('ustcStudentInfoUniversity.fields.studentStatus')"
        prop="studentStatus"
      >
        <el-select
          v-model="queryParams.studentStatus"
          :placeholder="
            t('common.selectTextPlaceholder') + t('ustcStudentInfoUniversity.fields.studentStatus')
          "
          clearable
          class="!w-240px"
          :disabled="advancedSearching"
        >
          <el-option label="请选择字典生成" value="" />
        </el-select>
      </el-form-item>
      <el-form-item
        :label="t('ustcStudentInfoUniversity.fields.studentStatusChange')"
        prop="studentStatusChange"
      >
        <el-input
          v-model="queryParams.studentStatusChange"
          :placeholder="
            t('common.inputTextPlaceholder') +
            t('ustcStudentInfoUniversity.fields.studentStatusChange')
          "
          clearable
          @keyup.enter="handleQuery"
          class="!w-240px"
          :disabled="advancedSearching"
        />
      </el-form-item>
      <el-form-item
        :label="t('ustcStudentInfoUniversity.fields.admissionSeason')"
        prop="admissionSeason"
      >
        <el-input
          v-model="queryParams.admissionSeason"
          :placeholder="
            t('common.inputTextPlaceholder') + t('ustcStudentInfoUniversity.fields.admissionSeason')
          "
          clearable
          @keyup.enter="handleQuery"
          class="!w-240px"
          :disabled="advancedSearching"
        />
      </el-form-item>
      <el-form-item
        :label="t('ustcStudentInfoUniversity.fields.admissionTime')"
        prop="admissionTime"
      >
        <el-date-picker
          v-model="queryParams.admissionTime"
          value-format="YYYY-MM-DD HH:mm:ss"
          type="daterange"
          :start-placeholder="t('common.startTimeText')"
          :end-placeholder="t('common.endTimeText')"
          :default-time="[new Date('1 00:00:00'), new Date('1 23:59:59')]"
          class="!w-220px"
          :disabled="advancedSearching"
        />
      </el-form-item>
      <el-form-item
        :label="t('ustcStudentInfoUniversity.fields.admissionType')"
        prop="admissionType"
      >
        <el-select
          v-model="queryParams.admissionType"
          :placeholder="
            t('common.selectTextPlaceholder') + t('ustcStudentInfoUniversity.fields.admissionType')
          "
          clearable
          class="!w-240px"
          :disabled="advancedSearching"
        >
          <el-option label="请选择字典生成" value="" />
        </el-select>
      </el-form-item>
      <el-form-item :label="t('ustcStudentInfoUniversity.fields.studentType')" prop="studentType">
        <el-select
          v-model="queryParams.studentType"
          :placeholder="
            t('common.selectTextPlaceholder') + t('ustcStudentInfoUniversity.fields.studentType')
          "
          clearable
          class="!w-240px"
          :disabled="advancedSearching"
        >
          <el-option label="请选择字典生成" value="" />
        </el-select>
      </el-form-item>
      <el-form-item :label="t('ustcStudentInfoUniversity.fields.eduDuration')" prop="eduDuration">
        <el-input
          v-model="queryParams.eduDuration"
          :placeholder="
            t('common.inputTextPlaceholder') + t('ustcStudentInfoUniversity.fields.eduDuration')
          "
          clearable
          @keyup.enter="handleQuery"
          class="!w-240px"
          :disabled="advancedSearching"
        />
      </el-form-item>
      <el-form-item
        :label="t('ustcStudentInfoUniversity.fields.trainingLevel')"
        prop="trainingLevel"
      >
        <el-input
          v-model="queryParams.trainingLevel"
          :placeholder="
            t('common.inputTextPlaceholder') + t('ustcStudentInfoUniversity.fields.trainingLevel')
          "
          clearable
          @keyup.enter="handleQuery"
          class="!w-240px"
          :disabled="advancedSearching"
        />
      </el-form-item>
      <el-form-item :label="t('ustcStudentInfoUniversity.fields.grade')" prop="grade">
        <el-input
          v-model="queryParams.grade"
          :placeholder="
            t('common.inputTextPlaceholder') + t('ustcStudentInfoUniversity.fields.grade')
          "
          clearable
          @keyup.enter="handleQuery"
          class="!w-240px"
          :disabled="advancedSearching"
        />
      </el-form-item>
      <el-form-item :label="t('ustcStudentInfoUniversity.fields.faculty')" prop="faculty">
        <el-input
          v-model="queryParams.faculty"
          :placeholder="
            t('common.inputTextPlaceholder') + t('ustcStudentInfoUniversity.fields.faculty')
          "
          clearable
          @keyup.enter="handleQuery"
          class="!w-240px"
          :disabled="advancedSearching"
        />
      </el-form-item>
      <el-form-item :label="t('ustcStudentInfoUniversity.fields.major')" prop="major">
        <el-input
          v-model="queryParams.major"
          :placeholder="
            t('common.inputTextPlaceholder') + t('ustcStudentInfoUniversity.fields.major')
          "
          clearable
          @keyup.enter="handleQuery"
          class="!w-240px"
          :disabled="advancedSearching"
        />
      </el-form-item>
      <el-form-item :label="t('ustcStudentInfoUniversity.fields.category')" prop="category">
        <el-input
          v-model="queryParams.category"
          :placeholder="
            t('common.inputTextPlaceholder') + t('ustcStudentInfoUniversity.fields.category')
          "
          clearable
          @keyup.enter="handleQuery"
          class="!w-240px"
          :disabled="advancedSearching"
        />
      </el-form-item>
      <el-form-item
        :label="t('ustcStudentInfoUniversity.fields.firstLevelSubject')"
        prop="firstLevelSubject"
      >
        <el-input
          v-model="queryParams.firstLevelSubject"
          :placeholder="
            t('common.inputTextPlaceholder') +
            t('ustcStudentInfoUniversity.fields.firstLevelSubject')
          "
          clearable
          @keyup.enter="handleQuery"
          class="!w-240px"
          :disabled="advancedSearching"
        />
      </el-form-item>
      <el-form-item
        :label="t('ustcStudentInfoUniversity.fields.professionalDirection')"
        prop="professionalDirection"
      >
        <el-input
          v-model="queryParams.professionalDirection"
          :placeholder="
            t('common.inputTextPlaceholder') +
            t('ustcStudentInfoUniversity.fields.professionalDirection')
          "
          clearable
          @keyup.enter="handleQuery"
          class="!w-240px"
          :disabled="advancedSearching"
        />
      </el-form-item>
      <el-form-item
        :label="t('ustcStudentInfoUniversity.fields.trainingMethod')"
        prop="trainingMethod"
      >
        <el-input
          v-model="queryParams.trainingMethod"
          :placeholder="
            t('common.inputTextPlaceholder') + t('ustcStudentInfoUniversity.fields.trainingMethod')
          "
          clearable
          @keyup.enter="handleQuery"
          class="!w-240px"
          :disabled="advancedSearching"
        />
      </el-form-item>
      <el-form-item :label="t('ustcStudentInfoUniversity.fields.learnMethod')" prop="learnMethod">
        <el-input
          v-model="queryParams.learnMethod"
          :placeholder="
            t('common.inputTextPlaceholder') + t('ustcStudentInfoUniversity.fields.learnMethod')
          "
          clearable
          @keyup.enter="handleQuery"
          class="!w-240px"
          :disabled="advancedSearching"
        />
      </el-form-item>
      <el-form-item :label="t('ustcStudentInfoUniversity.fields.specialPlan')" prop="specialPlan">
        <el-input
          v-model="queryParams.specialPlan"
          :placeholder="
            t('common.inputTextPlaceholder') + t('ustcStudentInfoUniversity.fields.specialPlan')
          "
          clearable
          @keyup.enter="handleQuery"
          class="!w-240px"
          :disabled="advancedSearching"
        />
      </el-form-item>
      <el-form-item
        :label="t('ustcStudentInfoUniversity.fields.elecAcademicRegNote')"
        prop="elecAcademicRegNote"
      >
        <el-input
          v-model="queryParams.elecAcademicRegNote"
          :placeholder="
            t('common.inputTextPlaceholder') +
            t('ustcStudentInfoUniversity.fields.elecAcademicRegNote')
          "
          clearable
          @keyup.enter="handleQuery"
          class="!w-240px"
          :disabled="advancedSearching"
        />
      </el-form-item>
      <el-form-item :label="t('ustcStudentInfoUniversity.fields.classroom')" prop="classroom">
        <el-input
          v-model="queryParams.classroom"
          :placeholder="
            t('common.inputTextPlaceholder') + t('ustcStudentInfoUniversity.fields.classroom')
          "
          clearable
          @keyup.enter="handleQuery"
          class="!w-240px"
          :disabled="advancedSearching"
        />
      </el-form-item>
      <el-form-item
        :label="t('ustcStudentInfoUniversity.fields.primaryMentor')"
        prop="primaryMentor"
      >
        <el-input
          v-model="queryParams.primaryMentor"
          :placeholder="
            t('common.inputTextPlaceholder') + t('ustcStudentInfoUniversity.fields.primaryMentor')
          "
          clearable
          @keyup.enter="handleQuery"
          class="!w-240px"
          :disabled="advancedSearching"
        />
      </el-form-item>
      <el-form-item
        :label="t('ustcStudentInfoUniversity.fields.secondaryMentor')"
        prop="secondaryMentor"
      >
        <el-input
          v-model="queryParams.secondaryMentor"
          :placeholder="
            t('common.inputTextPlaceholder') + t('ustcStudentInfoUniversity.fields.secondaryMentor')
          "
          clearable
          @keyup.enter="handleQuery"
          class="!w-240px"
          :disabled="advancedSearching"
        />
      </el-form-item>
      <el-form-item
        :label="t('ustcStudentInfoUniversity.fields.residenceCampus')"
        prop="residenceCampus"
      >
        <el-input
          v-model="queryParams.residenceCampus"
          :placeholder="
            t('common.inputTextPlaceholder') + t('ustcStudentInfoUniversity.fields.residenceCampus')
          "
          clearable
          @keyup.enter="handleQuery"
          class="!w-240px"
          :disabled="advancedSearching"
        />
      </el-form-item>
      <el-form-item :label="t('ustcStudentInfoUniversity.fields.dormAddress')" prop="dormAddress">
        <el-input
          v-model="queryParams.dormAddress"
          :placeholder="
            t('common.inputTextPlaceholder') + t('ustcStudentInfoUniversity.fields.dormAddress')
          "
          clearable
          @keyup.enter="handleQuery"
          class="!w-240px"
          :disabled="advancedSearching"
        />
      </el-form-item>
      <el-form-item :label="t('ustcStudentInfoUniversity.fields.basicPeriod')" prop="basicPeriod">
        <el-date-picker
          v-model="queryParams.basicPeriod"
          value-format="YYYY-MM-DD"
          type="date"
          :placeholder="
            t('common.selectTextPlaceholder') + t('ustcStudentInfoUniversity.fields.basicPeriod')
          "
          clearable
          class="!w-240px"
          :disabled="advancedSearching"
        />
      </el-form-item>
      <el-form-item
        :label="t('ustcStudentInfoUniversity.fields.longestPeriod')"
        prop="longestPeriod"
      >
        <el-date-picker
          v-model="queryParams.longestPeriod"
          value-format="YYYY-MM-DD"
          type="date"
          :placeholder="
            t('common.selectTextPlaceholder') + t('ustcStudentInfoUniversity.fields.longestPeriod')
          "
          clearable
          class="!w-240px"
          :disabled="advancedSearching"
        />
      </el-form-item>
      <el-form-item
        :label="t('ustcStudentInfoUniversity.fields.registerStatus')"
        prop="registerStatus"
      >
        <el-select
          v-model="queryParams.registerStatus"
          :placeholder="
            t('common.selectTextPlaceholder') + t('ustcStudentInfoUniversity.fields.registerStatus')
          "
          clearable
          class="!w-240px"
          :disabled="advancedSearching"
        >
          <el-option label="请选择字典生成" value="" />
        </el-select>
      </el-form-item>
      <el-form-item
        :label="t('ustcStudentInfoUniversity.fields.fundingPeriod')"
        prop="fundingPeriod"
      >
        <el-date-picker
          v-model="queryParams.fundingPeriod"
          value-format="YYYY-MM-DD"
          type="date"
          :placeholder="
            t('common.selectTextPlaceholder') + t('ustcStudentInfoUniversity.fields.fundingPeriod')
          "
          clearable
          class="!w-240px"
          :disabled="advancedSearching"
        />
      </el-form-item>
      <el-form-item :label="t('ustcStudentInfoUniversity.fields.defenseDate')" prop="defenseDate">
        <el-date-picker
          v-model="queryParams.defenseDate"
          value-format="YYYY-MM-DD HH:mm:ss"
          type="daterange"
          :start-placeholder="t('common.startTimeText')"
          :end-placeholder="t('common.endTimeText')"
          :default-time="[new Date('1 00:00:00'), new Date('1 23:59:59')]"
          class="!w-220px"
          :disabled="advancedSearching"
        />
      </el-form-item>
      <el-form-item :label="t('ustcStudentInfoUniversity.fields.leaveDate')" prop="leaveDate">
        <el-date-picker
          v-model="queryParams.leaveDate"
          value-format="YYYY-MM-DD HH:mm:ss"
          type="daterange"
          :start-placeholder="t('common.startTimeText')"
          :end-placeholder="t('common.endTimeText')"
          :default-time="[new Date('1 00:00:00'), new Date('1 23:59:59')]"
          class="!w-220px"
          :disabled="advancedSearching"
        />
      </el-form-item>
      <el-form-item
        :label="t('ustcStudentInfoUniversity.fields.graduationConclusion')"
        prop="graduationConclusion"
      >
        <el-input
          v-model="queryParams.graduationConclusion"
          :placeholder="
            t('common.inputTextPlaceholder') +
            t('ustcStudentInfoUniversity.fields.graduationConclusion')
          "
          clearable
          @keyup.enter="handleQuery"
          class="!w-240px"
          :disabled="advancedSearching"
        />
      </el-form-item>
      <el-form-item
        :label="t('ustcStudentInfoUniversity.fields.graduationDate')"
        prop="graduationDate"
      >
        <el-date-picker
          v-model="queryParams.graduationDate"
          value-format="YYYY-MM-DD HH:mm:ss"
          type="daterange"
          :start-placeholder="t('common.startTimeText')"
          :end-placeholder="t('common.endTimeText')"
          :default-time="[new Date('1 00:00:00'), new Date('1 23:59:59')]"
          class="!w-220px"
          :disabled="advancedSearching"
        />
      </el-form-item>
      <el-form-item
        :label="t('ustcStudentInfoUniversity.fields.graduationNumber')"
        prop="graduationNumber"
      >
        <el-input
          v-model="queryParams.graduationNumber"
          :placeholder="
            t('common.inputTextPlaceholder') +
            t('ustcStudentInfoUniversity.fields.graduationNumber')
          "
          clearable
          @keyup.enter="handleQuery"
          class="!w-240px"
          :disabled="advancedSearching"
        />
      </el-form-item>
      <el-form-item :label="t('ustcStudentInfoUniversity.fields.degreeType')" prop="degreeType">
        <el-select
          v-model="queryParams.degreeType"
          :placeholder="
            t('common.selectTextPlaceholder') + t('ustcStudentInfoUniversity.fields.degreeType')
          "
          clearable
          class="!w-240px"
          :disabled="advancedSearching"
        >
          <el-option label="请选择字典生成" value="" />
        </el-select>
      </el-form-item>
      <el-form-item :label="t('ustcStudentInfoUniversity.fields.degree')" prop="degree">
        <el-input
          v-model="queryParams.degree"
          :placeholder="
            t('common.inputTextPlaceholder') + t('ustcStudentInfoUniversity.fields.degree')
          "
          clearable
          @keyup.enter="handleQuery"
          class="!w-240px"
          :disabled="advancedSearching"
        />
      </el-form-item>
      <el-form-item :label="t('ustcStudentInfoUniversity.fields.degreeDate')" prop="degreeDate">
        <el-date-picker
          v-model="queryParams.degreeDate"
          value-format="YYYY-MM-DD HH:mm:ss"
          type="daterange"
          :start-placeholder="t('common.startTimeText')"
          :end-placeholder="t('common.endTimeText')"
          :default-time="[new Date('1 00:00:00'), new Date('1 23:59:59')]"
          class="!w-220px"
          :disabled="advancedSearching"
        />
      </el-form-item>
      <el-form-item
        :label="t('ustcStudentInfoUniversity.fields.phdInResearch')"
        prop="phdInResearch"
      >
        <el-select
          v-model="queryParams.phdInResearch"
          :placeholder="
            t('common.selectTextPlaceholder') + t('ustcStudentInfoUniversity.fields.phdInResearch')
          "
          clearable
          class="!w-240px"
          :disabled="advancedSearching"
        >
          <el-option label="请选择字典生成" value="" />
        </el-select>
      </el-form-item>
      <el-form-item :label="t('ustcStudentInfoUniversity.fields.transferYear')" prop="transferYear">
        <el-input
          v-model="queryParams.transferYear"
          :placeholder="
            t('common.inputTextPlaceholder') + t('ustcStudentInfoUniversity.fields.transferYear')
          "
          clearable
          @keyup.enter="handleQuery"
          class="!w-240px"
          :disabled="advancedSearching"
        />
      </el-form-item>
      <el-form-item
        :label="t('ustcStudentInfoUniversity.fields.destinationType')"
        prop="destinationType"
      >
        <el-select
          v-model="queryParams.destinationType"
          :placeholder="
            t('common.selectTextPlaceholder') +
            t('ustcStudentInfoUniversity.fields.destinationType')
          "
          clearable
          class="!w-240px"
          :disabled="advancedSearching"
        >
          <el-option label="请选择字典生成" value="" />
        </el-select>
      </el-form-item>
      <el-form-item
        :label="t('ustcStudentInfoUniversity.fields.destinationUnit')"
        prop="destinationUnit"
      >
        <el-input
          v-model="queryParams.destinationUnit"
          :placeholder="
            t('common.inputTextPlaceholder') + t('ustcStudentInfoUniversity.fields.destinationUnit')
          "
          clearable
          @keyup.enter="handleQuery"
          class="!w-240px"
          :disabled="advancedSearching"
        />
      </el-form-item>
      <el-form-item
        :label="t('ustcStudentInfoUniversity.fields.archiveAddress')"
        prop="archiveAddress"
      >
        <el-input
          v-model="queryParams.archiveAddress"
          :placeholder="
            t('common.inputTextPlaceholder') + t('ustcStudentInfoUniversity.fields.archiveAddress')
          "
          clearable
          @keyup.enter="handleQuery"
          class="!w-240px"
          :disabled="advancedSearching"
        />
      </el-form-item>
      <el-form-item
        :label="t('ustcStudentInfoUniversity.fields.archiveContact')"
        prop="archiveContact"
      >
        <el-input
          v-model="queryParams.archiveContact"
          :placeholder="
            t('common.inputTextPlaceholder') + t('ustcStudentInfoUniversity.fields.archiveContact')
          "
          clearable
          @keyup.enter="handleQuery"
          class="!w-240px"
          :disabled="advancedSearching"
        />
      </el-form-item>
      <el-form-item
        :label="t('ustcStudentInfoUniversity.fields.archiveTelephone')"
        prop="archiveTelephone"
      >
        <el-input
          v-model="queryParams.archiveTelephone"
          :placeholder="
            t('common.inputTextPlaceholder') +
            t('ustcStudentInfoUniversity.fields.archiveTelephone')
          "
          clearable
          @keyup.enter="handleQuery"
          class="!w-240px"
          :disabled="advancedSearching"
        />
      </el-form-item>
      <el-form-item :label="t('ustcStudentInfoUniversity.fields.confirmLeave')" prop="confirmLeave">
        <el-select
          v-model="queryParams.confirmLeave"
          :placeholder="
            t('common.selectTextPlaceholder') + t('ustcStudentInfoUniversity.fields.confirmLeave')
          "
          clearable
          class="!w-240px"
          :disabled="advancedSearching"
        >
          <el-option label="请选择字典生成" value="" />
        </el-select>
      </el-form-item>
      <el-form-item :label="t('ustcStudentInfoUniversity.fields.remark')" prop="remark">
        <el-input
          v-model="queryParams.remark"
          :placeholder="
            t('common.inputTextPlaceholder') + t('ustcStudentInfoUniversity.fields.remark')
          "
          clearable
          @keyup.enter="handleQuery"
          class="!w-240px"
          :disabled="advancedSearching"
        />
      </el-form-item>
      <el-form-item :label="t('ustcStudentInfoUniversity.fields.createTime')" prop="createTime">
        <el-date-picker
          v-model="queryParams.createTime"
          value-format="YYYY-MM-DD HH:mm:ss"
          type="daterange"
          :start-placeholder="t('common.startTimeText')"
          :end-placeholder="t('common.endTimeText')"
          :default-time="[new Date('1 00:00:00'), new Date('1 23:59:59')]"
          class="!w-220px"
          :disabled="advancedSearching"
        />
      </el-form-item>
      <el-form-item>
        <el-button @click="handleQuery" :disabled="advancedSearching">
          <Icon icon="ep:search" class="mr-5px" />
          {{ t('common.search') }}
        </el-button>
        <el-button @click="resetQuery" :disabled="advancedSearching">
          <Icon icon="ep:refresh" class="mr-5px" />
          {{ t('common.reset') }}
        </el-button>
        <el-button
          type="primary"
          plain
          @click="openForm('create')"
          v-hasPermi="['core:ustc-student-info-university:create']"
        >
          <Icon icon="ep:plus" class="mr-5px" />
          {{ t('action.add') }}
        </el-button>
        <el-button
          type="warning"
          plain
          @click="handleImport"
          v-hasPermi="['core:ustc-student-info-university:export']"
        >
          <Icon icon="ep:upload" class="mr-5px" />
          {{ t('action.import') }}
        </el-button>
        <el-button
          type="success"
          plain
          @click="handleExport"
          :loading="exportLoading"
          v-hasPermi="['core:ustc-student-info-university:export']"
        >
          <Icon icon="ep:download" class="mr-5px" />
          {{ t('action.export') }}
        </el-button>
        <ConditionTree
          id="studentinfouniversity-condition-tree"
          :schemata="ustcStudentInfoUniversitySchema"
          @search="handleAdvanceSearch"
        />
      </el-form-item>
    </el-form>
  </ContentWrap>

  <!-- 列表 -->
  <ContentWrap>
    <vxe-toolbar ref="toolbarRef" custom />
    <vxe-table
      id="iStudentInfoUniversity-table"
      ref="tableRef"
      v-loading="loading"
      :data="list"
      stripe
      :custom-config="vxeTableConfig"
      :column-config="{ resizable: true }"
      :size="vxeTableSize"
    >
      <vxe-column :title="t('common.index')" type="seq" field="seq" width="60" align="center" />
      <vxe-column
        :title="t('ustcStudentInfoUniversity.fields.id')"
        field="id"
        align="center"
        show-header-overflow
        show-overflow
        min-width="100"
      />
      <vxe-column
        :title="t('ustcStudentInfoUniversity.fields.accountId')"
        field="accountId"
        align="center"
        show-header-overflow
        show-overflow
        min-width="100"
      />
      <vxe-column
        :title="t('ustcStudentInfoUniversity.fields.inschoolFlag')"
        field="inschoolFlag"
        align="center"
        show-header-overflow
        show-overflow
        min-width="100"
      />
      <vxe-column
        :title="t('ustcStudentInfoUniversity.fields.studentStatus')"
        field="studentStatus"
        align="center"
        show-header-overflow
        show-overflow
        min-width="100"
      />
      <vxe-column
        :title="t('ustcStudentInfoUniversity.fields.studentStatusChange')"
        field="studentStatusChange"
        align="center"
        show-header-overflow
        show-overflow
        min-width="100"
      />
      <vxe-column
        :title="t('ustcStudentInfoUniversity.fields.admissionSeason')"
        field="admissionSeason"
        align="center"
        show-header-overflow
        show-overflow
        min-width="100"
      />
      <vxe-column
        :title="t('ustcStudentInfoUniversity.fields.admissionTime')"
        field="admissionTime"
        align="center"
        show-header-overflow
        show-overflow
        min-width="100"
        :formatter="vxeDateFormatter"
      />
      <vxe-column
        :title="t('ustcStudentInfoUniversity.fields.admissionType')"
        field="admissionType"
        align="center"
        show-header-overflow
        show-overflow
        min-width="100"
      />
      <vxe-column
        :title="t('ustcStudentInfoUniversity.fields.studentType')"
        field="studentType"
        align="center"
        show-header-overflow
        show-overflow
        min-width="100"
      />
      <vxe-column
        :title="t('ustcStudentInfoUniversity.fields.eduDuration')"
        field="eduDuration"
        align="center"
        show-header-overflow
        show-overflow
        min-width="100"
      />
      <vxe-column
        :title="t('ustcStudentInfoUniversity.fields.trainingLevel')"
        field="trainingLevel"
        align="center"
        show-header-overflow
        show-overflow
        min-width="100"
      />
      <vxe-column
        :title="t('ustcStudentInfoUniversity.fields.grade')"
        field="grade"
        align="center"
        show-header-overflow
        show-overflow
        min-width="100"
      />
      <vxe-column
        :title="t('ustcStudentInfoUniversity.fields.faculty')"
        field="faculty"
        align="center"
        show-header-overflow
        show-overflow
        min-width="100"
      />
      <vxe-column
        :title="t('ustcStudentInfoUniversity.fields.major')"
        field="major"
        align="center"
        show-header-overflow
        show-overflow
        min-width="100"
      />
      <vxe-column
        :title="t('ustcStudentInfoUniversity.fields.category')"
        field="category"
        align="center"
        show-header-overflow
        show-overflow
        min-width="100"
      />
      <vxe-column
        :title="t('ustcStudentInfoUniversity.fields.firstLevelSubject')"
        field="firstLevelSubject"
        align="center"
        show-header-overflow
        show-overflow
        min-width="100"
      />
      <vxe-column
        :title="t('ustcStudentInfoUniversity.fields.professionalDirection')"
        field="professionalDirection"
        align="center"
        show-header-overflow
        show-overflow
        min-width="100"
      />
      <vxe-column
        :title="t('ustcStudentInfoUniversity.fields.trainingMethod')"
        field="trainingMethod"
        align="center"
        show-header-overflow
        show-overflow
        min-width="100"
      />
      <vxe-column
        :title="t('ustcStudentInfoUniversity.fields.learnMethod')"
        field="learnMethod"
        align="center"
        show-header-overflow
        show-overflow
        min-width="100"
      />
      <vxe-column
        :title="t('ustcStudentInfoUniversity.fields.specialPlan')"
        field="specialPlan"
        align="center"
        show-header-overflow
        show-overflow
        min-width="100"
      />
      <vxe-column
        :title="t('ustcStudentInfoUniversity.fields.elecAcademicRegNote')"
        field="elecAcademicRegNote"
        align="center"
        show-header-overflow
        show-overflow
        min-width="100"
      />
      <vxe-column
        :title="t('ustcStudentInfoUniversity.fields.classroom')"
        field="classroom"
        align="center"
        show-header-overflow
        show-overflow
        min-width="100"
      />
      <vxe-column
        :title="t('ustcStudentInfoUniversity.fields.primaryMentor')"
        field="primaryMentor"
        align="center"
        show-header-overflow
        show-overflow
        min-width="100"
      />
      <vxe-column
        :title="t('ustcStudentInfoUniversity.fields.secondaryMentor')"
        field="secondaryMentor"
        align="center"
        show-header-overflow
        show-overflow
        min-width="100"
      />
      <vxe-column
        :title="t('ustcStudentInfoUniversity.fields.residenceCampus')"
        field="residenceCampus"
        align="center"
        show-header-overflow
        show-overflow
        min-width="100"
      />
      <vxe-column
        :title="t('ustcStudentInfoUniversity.fields.dormAddress')"
        field="dormAddress"
        align="center"
        show-header-overflow
        show-overflow
        min-width="100"
      />
      <vxe-column
        :title="t('ustcStudentInfoUniversity.fields.basicPeriod')"
        field="basicPeriod"
        align="center"
        show-header-overflow
        show-overflow
        min-width="100"
        :formatter="vxeDateFormatter"
      />
      <vxe-column
        :title="t('ustcStudentInfoUniversity.fields.longestPeriod')"
        field="longestPeriod"
        align="center"
        show-header-overflow
        show-overflow
        min-width="100"
        :formatter="vxeDateFormatter"
      />
      <vxe-column
        :title="t('ustcStudentInfoUniversity.fields.registerStatus')"
        field="registerStatus"
        align="center"
        show-header-overflow
        show-overflow
        min-width="100"
      />
      <vxe-column
        :title="t('ustcStudentInfoUniversity.fields.fundingPeriod')"
        field="fundingPeriod"
        align="center"
        show-header-overflow
        show-overflow
        min-width="100"
        :formatter="vxeDateFormatter"
      />
      <vxe-column
        :title="t('ustcStudentInfoUniversity.fields.defenseDate')"
        field="defenseDate"
        align="center"
        show-header-overflow
        show-overflow
        min-width="100"
        :formatter="vxeDateFormatter"
      />
      <vxe-column
        :title="t('ustcStudentInfoUniversity.fields.leaveDate')"
        field="leaveDate"
        align="center"
        show-header-overflow
        show-overflow
        min-width="100"
        :formatter="vxeDateFormatter"
      />
      <vxe-column
        :title="t('ustcStudentInfoUniversity.fields.graduationConclusion')"
        field="graduationConclusion"
        align="center"
        show-header-overflow
        show-overflow
        min-width="100"
      />
      <vxe-column
        :title="t('ustcStudentInfoUniversity.fields.graduationDate')"
        field="graduationDate"
        align="center"
        show-header-overflow
        show-overflow
        min-width="100"
        :formatter="vxeDateFormatter"
      />
      <vxe-column
        :title="t('ustcStudentInfoUniversity.fields.graduationNumber')"
        field="graduationNumber"
        align="center"
        show-header-overflow
        show-overflow
        min-width="100"
      />
      <vxe-column
        :title="t('ustcStudentInfoUniversity.fields.degreeType')"
        field="degreeType"
        align="center"
        show-header-overflow
        show-overflow
        min-width="100"
      />
      <vxe-column
        :title="t('ustcStudentInfoUniversity.fields.degree')"
        field="degree"
        align="center"
        show-header-overflow
        show-overflow
        min-width="100"
      />
      <vxe-column
        :title="t('ustcStudentInfoUniversity.fields.degreeDate')"
        field="degreeDate"
        align="center"
        show-header-overflow
        show-overflow
        min-width="100"
        :formatter="vxeDateFormatter"
      />
      <vxe-column
        :title="t('ustcStudentInfoUniversity.fields.phdInResearch')"
        field="phdInResearch"
        align="center"
        show-header-overflow
        show-overflow
        min-width="100"
      />
      <vxe-column
        :title="t('ustcStudentInfoUniversity.fields.transferYear')"
        field="transferYear"
        align="center"
        show-header-overflow
        show-overflow
        min-width="100"
      />
      <vxe-column
        :title="t('ustcStudentInfoUniversity.fields.destinationType')"
        field="destinationType"
        align="center"
        show-header-overflow
        show-overflow
        min-width="100"
      />
      <vxe-column
        :title="t('ustcStudentInfoUniversity.fields.destinationUnit')"
        field="destinationUnit"
        align="center"
        show-header-overflow
        show-overflow
        min-width="100"
      />
      <vxe-column
        :title="t('ustcStudentInfoUniversity.fields.archiveAddress')"
        field="archiveAddress"
        align="center"
        show-header-overflow
        show-overflow
        min-width="100"
      />
      <vxe-column
        :title="t('ustcStudentInfoUniversity.fields.archiveContact')"
        field="archiveContact"
        align="center"
        show-header-overflow
        show-overflow
        min-width="100"
      />
      <vxe-column
        :title="t('ustcStudentInfoUniversity.fields.archiveTelephone')"
        field="archiveTelephone"
        align="center"
        show-header-overflow
        show-overflow
        min-width="100"
      />
      <vxe-column
        :title="t('ustcStudentInfoUniversity.fields.confirmLeave')"
        field="confirmLeave"
        align="center"
        show-header-overflow
        show-overflow
        min-width="100"
      />
      <vxe-column
        :title="t('ustcStudentInfoUniversity.fields.remark')"
        field="remark"
        align="center"
        show-header-overflow
        show-overflow
        min-width="100"
      />
      <vxe-column
        :title="t('ustcStudentInfoUniversity.fields.createTime')"
        field="createTime"
        align="center"
        show-header-overflow
        show-overflow
        min-width="100"
        :formatter="vxeDateFormatter"
      />
      <vxe-column
        :title="t('common.operate')"
        field="operator"
        align="center"
        fixed="right"
        width="140"
      >
        <template #default="scope">
          <el-button
            link
            type="primary"
            @click="openForm('update', scope.row.id)"
            v-hasPermi="['core:ustc-student-info-university:update']"
          >
            {{ t('action.edit') }}
          </el-button>
          <el-button
            link
            type="danger"
            @click="handleDelete(scope.row.id)"
            v-hasPermi="['core:ustc-student-info-university:delete']"
          >
            {{ t('action.delete') }}
          </el-button>
        </template>
      </vxe-column>
    </vxe-table>
    <!-- 分页 -->
    <Pagination
      :total="total"
      v-model:page="queryParams.pageNo"
      v-model:limit="queryParams.pageSize"
      @pagination="getList"
    />
  </ContentWrap>

  <!-- 表单弹窗：添加/修改 -->
  <UstcStudentInfoUniversityForm ref="formRef" @success="getList" />
  <ExcelImportForm
    ref="importFormRef"
    object-name="学生在校信息"
    upload-url="/core/student-info-university/import"
    template-url="/core/student-info-university/get-import-template"
    @success="getList"
  />
</template>

<script setup lang="ts">
import { vxeDateFormatter } from '@/utils/formatTime'
import download from '@/utils/download'
import {
  UstcStudentInfoUniversityApi,
  UstcStudentInfoUniversityVO
} from '@/api/core/ustcstudentinfouniversity'
import UstcStudentInfoUniversityForm from './UstcStudentInfoUniversityForm.vue'
import ExcelImportForm from '@/components/ExcelImportForm/index.vue'
import type { VxeTablePropTypes, VxeToolbarInstance, VxeTableInstance } from 'vxe-table'
import { ustcStudentInfoUniversitySchema } from '@/views/core/ustcstudentinfouniversity/schema'
import { useAppStore } from '@/store/modules/app'

/** 学生在校信息 列表 */
defineOptions({ name: 'UstcStudentInfoUniversity' })

const message = useMessage() // 消息弹窗
const { t } = useI18n() // 国际化

const toolbarRef = ref<VxeToolbarInstance>()
const tableRef = ref<VxeTableInstance>()

const loading = ref(true) // 列表的加载中
const list = ref<UstcStudentInfoUniversityVO[]>([]) // 列表的数据
const total = ref(0) // 列表的总页数
const advancedSearching = ref(false) // 高级搜索
const queryParams = reactive({
  pageNo: 1,
  pageSize: 10,
  advanced: undefined,
  accountId: undefined,
  inschoolFlag: undefined,
  studentStatus: undefined,
  studentStatusChange: undefined,
  admissionSeason: undefined,
  admissionTime: [],
  admissionType: undefined,
  studentType: undefined,
  eduDuration: undefined,
  trainingLevel: undefined,
  grade: undefined,
  faculty: undefined,
  major: undefined,
  category: undefined,
  firstLevelSubject: undefined,
  professionalDirection: undefined,
  trainingMethod: undefined,
  learnMethod: undefined,
  specialPlan: undefined,
  elecAcademicRegNote: undefined,
  classroom: undefined,
  primaryMentor: undefined,
  secondaryMentor: undefined,
  residenceCampus: undefined,
  dormAddress: undefined,
  basicPeriod: undefined,
  longestPeriod: undefined,
  registerStatus: undefined,
  fundingPeriod: undefined,
  defenseDate: [],
  leaveDate: [],
  graduationConclusion: undefined,
  graduationDate: [],
  graduationNumber: undefined,
  degreeType: undefined,
  degree: undefined,
  degreeDate: [],
  phdInResearch: undefined,
  transferYear: undefined,
  destinationType: undefined,
  destinationUnit: undefined,
  archiveAddress: undefined,
  archiveContact: undefined,
  archiveTelephone: undefined,
  confirmLeave: undefined,
  remark: undefined,
  createTime: []
})
const queryFormRef = ref() // 搜索的表单
const exportLoading = ref(false) // 导出的加载中

const vxeTableConfig: VxeTablePropTypes.CustomConfig = {
  storage: true,
  mode: 'drawer',
  checkMethod({ column }) {
    return !['seq', 'operator'].includes(column.field)
  }
}

const appStore = useAppStore()
const vxeTableSize = computed(() => appStore.getCurrentSizeVxe)

/** 查询列表 */
const getList = async () => {
  loading.value = true
  try {
    const data = await UstcStudentInfoUniversityApi.getStudentInfoUniversityPage(queryParams)
    list.value = data.list
    total.value = data.total
  } finally {
    loading.value = false
  }
}

/** 搜索按钮操作 */
const handleQuery = () => {
  queryParams.pageNo = 1
  getList()
}

/** 重置按钮操作 */
const resetQuery = () => {
  queryFormRef.value.resetFields()
  advancedSearching.value = false
  ;(queryParams as any).advanced = undefined
  handleQuery()
}

/** 添加/修改操作 */
const formRef = ref<InstanceType<typeof UstcStudentInfoUniversityForm>>()
const openForm = (type: string, id?: number) => {
  formRef.value?.open(type, id)
}

/** 导入 */
const importFormRef = ref<InstanceType<typeof ExcelImportForm>>()
const handleImport = () => {
  importFormRef.value?.open()
}

/** 删除按钮操作 */
const handleDelete = async (id: number) => {
  try {
    // 删除的二次确认
    await message.delConfirm()
    // 发起删除
    await UstcStudentInfoUniversityApi.deleteStudentInfoUniversity(id)
    message.success(t('common.delSuccess'))
    // 刷新列表
    await getList()
  } catch {}
}

/** 导出按钮操作 */
const handleExport = async () => {
  try {
    // 导出的二次确认
    await message.exportConfirm()
    // 发起导出
    exportLoading.value = true
    const data = await UstcStudentInfoUniversityApi.exportStudentInfoUniversity(queryParams)
    download.excel(data, '学生在校信息.xlsx')
  } catch {
  } finally {
    exportLoading.value = false
  }
}

const handleAdvanceSearch = (base64Advanced?: string) => {
  ;(queryParams as any).advanced = base64Advanced
  advancedSearching.value = !!base64Advanced
  handleQuery()
}

/** 初始化 **/
onMounted(() => {
  getList()

  const table = tableRef.value
  const toolbar = toolbarRef.value
  if (table && toolbar) {
    table.connect(toolbar)
  }
})
</script>
